Skip to content

Enable install in non-top-level projects via NAMESPACE_INSTALL#19

Closed
sean-parent wants to merge 3 commits into
mainfrom
sen-parent/force-install
Closed

Enable install in non-top-level projects via NAMESPACE_INSTALL#19
sean-parent wants to merge 3 commits into
mainfrom
sen-parent/force-install

Conversation

@sean-parent
Copy link
Copy Markdown
Member

@sean-parent sean-parent commented Dec 22, 2025

Installation is now enabled if either building as a top-level project or if the ${NAMESPACE}_INSTALL variable is set to ON. Updated documentation to explain how to enable installation in non-top-level projects, improving support for package managers and advanced workflows.


Note

Medium Risk
Changes when install rules/config exports are generated, which can affect downstream consumers and packaging workflows if the new ${NAMESPACE}_INSTALL default/override is misapplied. Also bumps several CI/docs dependencies, which may cause minor build/CI behavior differences.

Overview
Installation is no longer tied solely to top-level builds. _cpp_library_setup_install() now defines and checks an uppercased ${NAMESPACE}_INSTALL option (default: PROJECT_IS_TOP_LEVEL) so installation/export rules can be explicitly enabled for non-top-level/CPM consumers or disabled for top-level builds.

Docs/CI updates. README is updated with CPM setup and examples for toggling ${NAMESPACE}_INSTALL, the CI workflow template is parameterized to centralize GitHub Action version refs (and adds MSVC env setup), and dependency versions are bumped (e.g., doctest, doxygen-awesome-css) plus Doxygen graph generation is disabled in templates/Doxyfile.in.

Reviewed by Cursor Bugbot for commit fa53f42. Bugbot is set up for automated code reviews on this repo. Configure here.

Installation is now enabled if either building as a top-level project or if the `${NAMESPACE}_INSTALL` variable is set to ON. Updated documentation to explain how to enable installation in non-top-level projects, improving support for package managers and advanced workflows.
Introduces a CMake option `${NAMESPACE}_INSTALL` (defaulting to `PROJECT_IS_TOP_LEVEL`) to explicitly enable or disable installation of the library. Updates documentation and refactors install logic to use this option, allowing more flexible control for both top-level and subproject builds.
- Updated doctest dependency version from 2.4.12 to 2.5.2 in cpp-library.cmake.
- Improved README.md with additional setup instructions for CPM.cmake and local usage examples.
- Refined CI workflow configuration in ci.yml and ci.yml.in to utilize defined action variables for better maintainability.
- Updated Doxygen theme dependency version from 2.4.1 to 2.4.2 in cpp-library-docs.cmake.
- Added new graph options in Doxyfile.in to control documentation output.
@sean-parent sean-parent deleted the sen-parent/force-install branch May 20, 2026 21:09
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit fa53f42. Configure here.

steps:
- uses: actions/checkout@v6
- uses: @CI_ACTION_CHECKOUT@
- if: ${{ startsWith(matrix.config.os, 'windows') }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI template references non-existent matrix.config.os path

High Severity

The newly added MSVC dev cmd step uses matrix.config.os but the matrix defines os directly on each entry, not nested under a config key. The runs-on directive on line 35 correctly references matrix.os. Since matrix.config is undefined, startsWith(matrix.config.os, 'windows') will always evaluate to false, so the MSVC developer environment will never be activated on Windows builds — likely causing build failures for all generated CI workflows.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fa53f42. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant